package com.king.modules.system.controller;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.king.common.annotation.Log;
import com.king.common.enums.BusinessType;
import com.king.common.utils.poi.ExcelUtil;
import com.king.framework.base.controller.YyBaseController;
import com.king.modules.system.domain.SysDictDataEntity;
import com.king.modules.system.service.SysDictDataService;

/**
 * 数据字典信息
 * 
 * @author king
 */
@RestController
@RequestMapping("/system/dictData")
public class SysDictDataController extends YyBaseController<SysDictDataEntity> {
	@Autowired
	private SysDictDataService dictDataService;



	@Log(title = "字典数据", businessType = BusinessType.EXPORT)
	@PreAuthorize("@sps.hasAuthority('system:dict:export')")
	@PostMapping("/export")
	public void export(HttpServletResponse response, SysDictDataEntity dictData) {
		List<SysDictDataEntity> list = dictDataService.selectDictDataList(dictData);
		ExcelUtil<SysDictDataEntity> util = new ExcelUtil<SysDictDataEntity>(SysDictDataEntity.class);
		util.exportExcel(response, list, "字典数据");
	}

}
